-
Notifications
You must be signed in to change notification settings - Fork 61
Turn on units of measure (BREAKING CHANGE) #6343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed Walltime Performance ReportMerging #6343 will improve performances by 28.16%Comparing
|
Benchmark | BASE |
HEAD |
Change | |
---|---|---|---|---|
⚡ | execute_pipe-with-bend |
1.2 s | 1.1 s | +11.09% |
⚡ | digest_big_kitt |
536.1 µs | 441.5 µs | +21.41% |
⚡ | digest_cube |
27.6 µs | 22.8 µs | +20.94% |
⚡ | digest_lsystem |
141.2 µs | 116.5 µs | +21.18% |
⚡ | digest_math |
102.8 µs | 80.2 µs | +28.16% |
⚡ | digest_mike_stress_test |
1.8 ms | 1.4 ms | +27.46% |
⚡ | digest_pipes_on_pipes |
1.9 ms | 1.6 ms | +20.84% |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6343 +/- ##
==========================================
+ Coverage 85.16% 85.34% +0.17%
==========================================
Files 108 108
Lines 46436 46437 +1
==========================================
+ Hits 39547 39630 +83
+ Misses 6889 6807 -82
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a couple minor things. Hard to say if we've caught everything and propagated types everywhere we need to though.
As a user debugging after this change, I feel like I'm going to want to inspect values to know whether they've converted properly. I.e. what is the runtime value of this variable in some function? It used to be whatever number I passed in. But now it may have converted based on units in an intermediate function before being passed on. |
Yeah! It's actually more complicated than that because numbers might be converted when they're passed to a function or when they're sent to the engine. I'm not really sure how to give users more insight. I really want to have values or at least types on hover but without access to program memory from the LSP or static checking, that isn't possible. |
There's currently a log pane, but we don't use it. What do you think about adding a log() or println() function and returning it from execution? |
CodSpeed Instrumentation Performance ReportMerging #6343 will not alter performanceComparing Summary
|
There's already a log function in src/log.rs, but it doesn't use the log pane, it writes to the console (and it's dev-oriented rather than user-oriented). I think it's a good idea though. I wonder if we could include more numbers in the operation view thing? |
Do you mean Operations in the Feature Tree? We've already been talking about showing variable definitions in there #5729 (comment). And the plan has been for a long time to be able to expand function calls to see inside them. We already record the arguments for function calls in Operations. We just haven't gotten to the UI for it yet. For logs, I was thinking about something more explicit the way you might use println in Rust. Ideally it would appear as the KCL is executing, but a simple implementation would just return all the logs to be displayed at the end. One complication is logs would need to be merged from parallel executed modules. |
Yeah. I don't think we'd need to show variables, just the arguments to std functions and the values sent with the modelling commands. Though I guess variables might be useful for debugging (we already send variable values to the frontend from the interpreter, so that wouldn't be too hard, at least for variables outside of a function).
Oh like a
Yeah... |
Signed-off-by: Nick Cameron <[email protected]>
Signed-off-by: Nick Cameron <[email protected]>
Cherry-picked #6431 |
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
* Turn on uom checks Signed-off-by: Nick Cameron <[email protected]> * Convert all lengths to mm for engine calls Signed-off-by: Nick Cameron <[email protected]> --------- Signed-off-by: Nick Cameron <[email protected]>
This adds checks for UoM and turns off the warnings for using suffixes etc. It changes the way we use the engine to always send commands in mm and never setting the scene units to the default.